<template>
  <div>
    <DockerTitle titleText="检查结果"></DockerTitle>
    <el-divider></el-divider>
    <el-table :data="tableData" @row-dblclick="changeRow"> <!--@row-dblclick 双击 事件-->
      <el-table-column label="检查编码" prop="medicalTechnology.techCode"></el-table-column>
      <el-table-column label="检查名称" prop="medicalTechnology.techName"></el-table-column>
      <el-table-column width="100px" label="规格" prop="medicalTechnology.techFormat"></el-table-column>
      <el-table-column width="100px" label="单价" prop="medicalTechnology.techPrice"></el-table-column>
      <el-table-column width="100px" label="状态" prop="checkState"></el-table-column>
      <el-table-column width="100px" label="费用分类" prop="medicalTechnology.priceType"></el-table-column>
    </el-table>
    <el-descriptions
      style="margin-top: 40px;"
      title="检查结果详情"
      :column="1"
      border
      class="result-descrption">
      <el-descriptions-item label="开立时间">{{desc.creationTime}}</el-descriptions-item>
      <el-descriptions-item label="检查医生">{{desc.checkEmpName}}</el-descriptions-item>
      <el-descriptions-item label="检查部位">{{desc.checkPosition}}</el-descriptions-item>
      <el-descriptions-item label="目的要求">{{desc.checkInfo}}</el-descriptions-item>
      <el-descriptions-item label="医嘱备注">{{desc.checkRemark}}</el-descriptions-item>
      <el-descriptions-item label="检查结果">{{desc.checkResult}}</el-descriptions-item>
      <el-descriptions-item label="检查时间">{{desc.checkTime}}</el-descriptions-item>
    </el-descriptions>
  </div>
</template>

<script setup>
import DockerTitle from '@/components/doctor/title'
import { get } from '@/utils/axios'
import { RegisterStore } from '@/stores/counter'
import { reactive, ref } from 'vue'
const useRegisterStore = RegisterStore() // 状态管理
const register = useRegisterStore.get()
const query = reactive({
  checkState: '已出结果',
  registerId: register.value.id
})
const tableData = ref([])
const desc = ref({})
getTableData()
function getTableData () {
  get('/checkRequest/getResult', query, content => {
    tableData.value = content
  })
}
function changeRow (row) {
  desc.value = row
  console.dir(row)
}
</script>

<style scoped lang="scss">
.result-descrption {
  ::v-deep {
    .is-bordered-label{
      width: 150px;
    }
  }
}
</style>
